#!/bin/bash

case $1 in
    start | stop | status)
        for host in hadoop162 hadoop163 hadoop164 ; do
            echo "========== $host ========="
        ssh $host "source /etc/profile; /opt/module/zookeeper-3.5.7/bin/zkServer.sh $1"
        done

       ;;

    *)
        echo "你启动的姿势不对"
        echo "  start   启动zookeeper集群"
        echo "  stop    停止zookeeper集群"
        echo "  status  查看zookeeper集群"
    ;;
esac
